package org.bitejiuyeke.lesson01;

public class Demo03_Runnable {
    public static void main(String[] args) {
        MyRunnable02 myRunnable02_1=new MyRunnable02();
        MyRunnable02 myRunnable02_2=new MyRunnable02();
        MyRunnable03 myRunnable03=new MyRunnable03();
        Thread thread1=new Thread(myRunnable02_1);
        Thread thread2=new Thread(myRunnable02_2);
        Thread thread3=new Thread(myRunnable03);
        thread1.start();
        thread2.start();
        thread3.start();
    }

}
class MyRunnable02 implements  Runnable{
    @Override
    public void run() {
        while (true){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("皮鞋+2金币");
        }
    }
}

class MyRunnable03 implements  Runnable{
    @Override
    public void run() {
        while (true){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("皮包+5金币");
        }
    }
}